package com.hyr.springcloud.multi.controller;

import com.hyr.springcloud.multi.domain.Order;
import com.hyr.springcloud.multi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("createorder")
    public Object createOrder(Order order){
        userService.createOrder(order);
        return "ok";
    }

    @RequestMapping("getuser")
    public Object getuser(int userid){
        return  userService.userInfo(userid);
    }

}
